package com.dlwx.firefighting.utils;

import android.support.v7.app.AppCompatActivity;
import android.view.Window;
import android.view.WindowManager;

/**
 * Created by Administrator on 2017/7/5.
 */

public class MyStatusBar {

    //如果是小米手机则隐藏状态栏，否则显示沉浸式状态栏
    public static void setStatusBar(AppCompatActivity activity, int color,int alpha) {
        if (JudgePhoneBrand.SYS_MIUI.equals(JudgePhoneBrand.getSystem())) {
            activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
            activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
        } else {
            StatusBarUtil.setColor(activity, color, alpha);
        }
    }
}
